                                  Readme for: 
                    "Gender Gaps in Support for Vigilante Violence"
                                Anna M. Wilke

                                   Contents

- 01_data/                              =    Contains raw data
    - afrobarometer.csv                 =    Relevant variables from Afrobarometer Round 5
    - icpr.csv                          =    Relevant variables from the World Prison Brief (2018) by the Institute for Crime & Justice Policy Research (ICPR)
    - south_africa.csv                  =    Data from South Africa collected by Citizen Surveys in May 2018
    - tanzania1.csv                     =    Round 1 HH survey data from Tanzania
    - tanzania2.csv                     =    Round 2 HH survey data from Tanzania
    - tanzania3.csv                     =    Round 2 HH survey data from Tanzania
    - uganda1.csv                       =    Round 1 HH survey data from Uganda
    - uganda2_1.csv                     =    Round 2 HH survey data from Uganda
    - uganda2_2.csv                     =    Round 2 HH survey data from Uganda
    - uganda2_3_1.csv                   =    Round 2 HH survey data from Uganda
    - uganda2_3_2.csv                   =    Round 2 HH survey data from Uganda
    - uganda2_3.csv                     =    Round 2 HH survey data from Uganda
    - uganda2_2.csv                     =    Round 2 HH survey data from Uganda
    - uganda2_5.csv                     =    Round 2 HH survey data from Uganda
    - uganda3_1.csv                     =    Round 3 HH survey data from Uganda
    - uganda3_2.csv                     =    Round 3 HH survey data from Uganda
    - uganda3_3.csv                     =    Round 3 HH survey data from Uganda
    - uganda3_4.csv                     =    Round 3 HH survey data from Uganda
    - all_data.Rdata                    =    Stores cleaned versions of individual and combined datasets
- 02_codebooks/                         =    Contains codebooks for all datasets where coding is not obvious (tanzania1 dataset has labels and hence no codebook)
    - afrobarometer.pdf                 =    Afrobarometer round 5 codebook
    - southafrica.xlsx                  =    Citizen Surveys South Africa codebook
    - tanzania2_choices.csv             =    Answer options for round 2 in Tanzania (SurveyCTO coding)
    - tanzania2_questions.csv           =    Question wording for round 2 in Tanzania (SurveyCTO coding)
    - uganda1_choices.csv               =    Answer options for round 1 in Uganda (SurveyCTO coding)
    - uganda1_Qs.csv                    =    Question wording for round 1 in Uganda (SurveyCTO coding)
    - uganda2_choices.csv               =    Answer options for round 2 in Uganda (SurveyCTO coding)
    - uganda2_Qs.csv                    =    Question wording for round 2 in Uganda (SurveyCTO coding)
    - uganda3_choices.csv               =    Answer options for round 3 in Uganda (SurveyCTO coding)
    - uganda3_Qs.csv                    =    Question wording for round 3 in Uganda (SurveyCTO coding)
- 03_code/                              =    Code scripts
  - __main_script.R                     =    Main script that sources all other scripts - start from here
  - 00_data_loading/                    =    Scripts that load and clean data
  - 01_useful_functions/                =    Scripts that define functions used throughout
  - 02_variable_coding/                 =    Scripts that code all treatment and outcome data in individual datasets
  - 03_imputations/                     =    Scripts that impute outcomes in individual datasets
  - 04_merging/                         =    Scripts that combine relevant datasets
  - 05_analyses/                        =    Scripts that run the analyses and output tables/figures
- MV_replication.Rproj                  =    Start by opening the R project and run everything from here such that file paths work



                            How to run the code 

1. Open MV_replication.Rproj to ensure that all file paths 
   are set relative to the replication archive
2. The R package renv (0.15.4) has been used  to handle dependency on packages. The relevant files are contained in the folder called "renv." Call renv::restore() to install the relevant versions of all packages that are used throughout the code scripts. Careful: This can take a long time. 
3. Open __main_script.R and run all scripts from here
4. True / false logics determine whether you re-create the data

                      Explanations and clarifications

- The multiple versions of the raw data correspond to the different datasets
  output by surveyCTO when a change is made to the survey. Each change requires
  a new survey version, thus producing a new dataset.
- Cleaning scripts for all Uganda data implement modifications made to data (changing of values, etc.) implemented by field manager over course of field work. 

														   